package com.deange.ropeprogressview;

import ohos.agp.animation.Animator;

/**
 * DampingInterpolator
 *
 * @author hw
 * @since 2021/5/29
 */
class DampingInterpolator implements Animator.TimelineCurve {
    private final float mCycles;

    DampingInterpolator() {
        this(1);
    }

    DampingInterpolator(float cycles) {
        mCycles = cycles;
    }

    @Override
    public float getCurvedTime(float input) {
        return (float) (Math.sin((double) mCycles * 2 * Math.PI * input) * (((double) input - 1) * ((double) input - 1)));
    }
}
